from typing import Optional, Tuple

from django.db.models import QuerySet

from server.apps.main.logic.todo import  queries
from server.apps.main.models import Todolist


def run(
    text: Optional[str],
)  -> QuerySet[Todolist]:
    """Validates data, maybe creates a new post, returns all published ones."""
    todolist = queries.find(text)
    return todolist
